<?php

    class conexao
    {
        private static $conexao;

		public static function Conectar()
		{
            if (empty (self::$conexao)) {
                #self::$conexao = pg_connect("host=172.30.116.22 port=5432 dbname=pmf_homol user=sgc password=sgc");
            	self::$conexao = pg_connect('host=172.30.41.24 port=5432 dbname=sgc user=sgc password=sgc');
            }
            
            return self::$conexao;
       	}
	        
		public static function Desconectar()
		{
            if (isset (self::$conexao) && pg_connection_status(self::$conexao))
            	pg_close();
		}
		
		public static function ConectarPMF()
		{
		    return pg_connect("host=172.30.116.2 port=5432 dbname=db_pmf user=sgc password=blablabla");
		}
    }
?>
